<!doctype html>
<html lang="zh-cn">
<head>
{% include "tdm_include_head_template.html" %}
<script type="text/javascript">
$(function() {
  sidebar_nav_clone();
});
</script>
</head>

<body class=" theme-blue">
{% include "tdm_include_navbar_template.html" %}

<div class="sidebar-nav">
  <ul id="city_jxd">
  {% for city in city_all %}
  <li>
    <a href="#" data-target=".{{city.name}}-menu" class="nav-header collapsed" data-toggle="collapse" aria-expanded="false">
      <i class="fa fa-fw fa-bars"></i>
      {{city.name}}
      {% if city.warning_nr %}
      <span class="badge badge-warning">{{city.warning_nr}}</span>
      {% endif %}
      {% if city.alert_nr %}
      <span class="badge badge-danger">{{city.alert_nr}}</span>
      {% endif %}
      <i class="fa fa-collapse"></i>
    </a>
  </li>
  <li>
    <ul class="{{city.name}}-menu nav nav-list collapse {% ifequal view_city city.name %}in{% endifequal %}">
      {% for venue in city.venues %}
      <li>
        <a href="/tdm/power/{{city.name}}/{{venue.name}}">
          <span class="fa fa-caret-right"></span>
          {{venue.name}}
          {% if venue.warning_nr %}
          <div class="pull-right">
            <span class="badge badge-warning">{{venue.warning_nr}}</span>
          </div>
          {% endif %}
          {% if venue.alert_nr %}
          <div class="pull-right">
            <span class="badge badge-danger">{{venue.alert_nr}}</span>
          </div>
          {% endif %}
        </a>
      </li>
      {% endfor %}
    </ul>
  </li>
  {% endfor %}
  </ul>
</div>

<div class="content">
  <div class="header">
    <a class="btn btn-primary" rol="button" href="/tdm/mdm/{{view_city.name}}/{{view_venue.name}}/">
      {{view_city.name}} - {{view_venue.name}}
      <span class="glyphicon glyphicon-circle-arrow-right"></span>
    </a>
  </div>
  <div class="table-responsive">
    <table class="table table-hover">
      <tr>
        <th>教室</th>
        <th>移动设备数量</th>
        <th>在线数量</th>
      </tr>
      {% for classroom in classroom_list %}
      <tr>
        <td>
          <a href="/tdm/mdm/{{view_city.name}}/{{view_venue.name}}/{{classroom.devid}}">{{classroom.roomid}}</a>
          {% if classroom.warning_nr %}
          <span class="badge badge-warning">{{classroom.warning_nr}}</span>
          {% endif %}
          {% if classroom.alert_nr %}
          <span class="badge badge-danger">{{classroom.alert_nr}}</span>
          {% endif %}
        </td>
        <td>{{classroom.mdm_devs|length}}</td>
        <td>0</td>
      </tr>
      {% endfor %}
      {% if classroom_list|length_is:"0" %}
      <tr><td colspan="3" align="center">无设备</td></tr>
      {% endif %}
    </table>
  </div>

  {% include "tdm_include_footer_template.html" %}
</div>

</body>
</html>